package com.tsd.config;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.data.elasticsearch.ElasticsearchDataAutoConfiguration;
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchRestClientAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: ElasticsearchConfig
 * @Description: TODO
 * @Author:
 */
@Configuration
@PropertySource(value = {"classpath:elasticsearch.properties"}, ignoreResourceNotFound = true)
@ConditionalOnProperty(name = "elasticsearch.enable", havingValue = "false", matchIfMissing = true)
@EnableAutoConfiguration(exclude = {ElasticsearchRestClientAutoConfiguration.class, ElasticsearchDataAutoConfiguration.class})
public class ElasticsearchConfig {

    public static final Logger LOGGER = LoggerFactory.getLogger(ElasticsearchConfig.class);
}
